﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Model;
using System.Configuration;
using Ext.Net;
namespace TCDC_System.UserControl
{
    public partial class SiteAdd : System.Web.UI.UserControl
    {
        private tcdc_mst_site obj;

        protected void Page_Load(object sender, EventArgs e)
        {
            obj = new tcdc_mst_site();
            obj.strConn = ConfigurationManager.AppSettings["ConnString"];
        }

        public void Show()
        {
            WindowSiteAdd.Show();
        }

        protected void SaveSite(object sender, DirectEventArgs e)
        {
            obj.site_name_th = txt_site_name_th.Text;
            obj.site_name_en = txt_site_name_en.Text;
            obj.site_short_name = txt_site_short_name.Text;
            obj.insertData(obj);
            GridStore.DataSource = obj.getByObject(new tcdc_mst_site());
            GridStore.DataBind();
            FormPanel1.Reset();
            WindowSiteAdd.Hide();
        }
        public Store GridStore { get; set; }
    }
}

